<template>
  <div class="withdraw">
    <br>
    <!-- 表格 -->
    <el-table :data="withdraw">
      <el-table-column prop="id" label="编号" width="80" />
      <el-table-column prop="realname" label="用户名" />
      <el-table-column prop="telephone" label="手机号" />
      <el-table-column prop="idCard" label="身份证号码" />
      <el-table-column prop="bankCard" label="银行卡号" />
      <el-table-column prop="registerTime" label="注册时间" />
      <!-- <el-table-column prop="status" label="状态" /> -->
      <el-table-column label="操作" fixed="right">
        <template slot-scope="scope">
          <el-button type="primary" size="mini" @click="shenhe(scope.row)">审核</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 表格结束 -->
    <!-- 模态框 -->
    <el-dialog title="提现审核" :visible.sync="visible">
      <p>用户名：{{this.wit.realname}}</p>
      <p>余额：{{this.wit.balance}}</p>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submit">可提现</el-button>
        <el-button type="danger" @click="refuse">不可提现</el-button>
      </div>
    </el-dialog>
    <!-- 模态框结束 -->
  </div>
</template>
<script>
import { get } from "@/utils/request";
export default {
  data() {
    return {
      visible: false,
      withdraw: [],
      wit: []
    };
  },
  created() {
    this.loadWithDraw();
  },
  methods: {
    loadWithDraw() {
      let url = "http://localhost:8888/user/find_all";
      get(url).then(response => {
        this.withdraw = response.data;
      });
    },
    shenhe(row) {
      this.wit = row;
      this.visible = true;
    },
    submit() {
      // let url = "http://localhost:8888/user/auditing";
      // get(url, { id: this.Wit.id }).then(response => {
       this.$message({ type: "success", message: "提现成功" });
      //   this.loadWithDraw();
      // });
      this.visible = false;
     // this.loadWithDraw();
    },
    refuse() {
    this.$message({ type:"error", message: "提现失败" });
    this.visible = false;
    //this.loadWithDraw();
    }
  }
};
</script>